package com.agent.service.defaultimpl;

import com.agent.handler.absimpl.AbstractWebLogHandler;
import com.agent.logbean.WebLogBean;
import com.agent.service.OperationLogService;
import com.agent.task.OperationLogThread;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

/**
 * Created by fangjicai on 2020/5/31.
 */
@Component
public class DefaultWebLogHandler extends AbstractWebLogHandler<WebLogBean> {
    @Autowired
    private OperationLogService operationLogService;
    public DefaultWebLogHandler(ThreadPoolTaskExecutor threadPoolTaskExecutor) {
        super(threadPoolTaskExecutor);
    }
    @Override
    public void persistenceLog(WebLogBean webLogBean) throws Exception {
        this.threadPoolTaskExecutor.execute(new OperationLogThread(operationLogService,webLogBean));
    }
}
